/**
 * Created by zhangsong on 2019-01-17.
 */

const Sequelize = require('sequelize');
const { db } = require('../common/mysql');

const tableName = 'dbf';

const model = db.define(tableName, {
  point: {
    type: Sequelize.INTEGER,
    unique: 'compositeIndex',
    comment: '点'
  },
  date: {
    type: Sequelize.DATEONLY,
    unique: 'compositeIndex',
    comment: '日期',
  },
  temperature: {
    type: Sequelize.DOUBLE,
    comment: '温度',
  },
}, {
  tableName: tableName,
  comment: '记录表',
});
db.sync();

module.exports = model;

